/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package globalEvents;

import java.util.logging.Logger;
import javax.inject.Inject;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

/**
 *
 * @author Alvaro
 */
@WebListener
public class GlobalevHttpSessionListener implements HttpSessionListener {

  @Inject
  private GlobalevHttpSessionController _httpSessionController;

  @Override
  public void sessionCreated(final HttpSessionEvent se) {
    _httpSessionController.addSession(se.getSession());
  }

  @Override
  public void sessionDestroyed(final HttpSessionEvent se) {
    _httpSessionController.removeSession(se.getSession());
  }
}
